package com.cryptoneedle.garden.dto;


import com.cryptoneedle.garden.enums.SourceConnectType;
import com.cryptoneedle.garden.enums.SourceDatabaseType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * <p>description: 数据源目录响应VO - 不包含敏感信息 </p>
 *
 * @author CryptoNeedle
 * @date 2025-10-29
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class SourceCatalogDto {

    @Schema(name = "源数据源-目录名称", description = "数据源目录名称", example = "巡检管理系统")
    private String catalogName;

    @Schema(name = "服务器-主机", description = "服务器主机名或IP地址", example = "192.168.1.100")
    private String host;

    @Schema(name = "服务器-端口", description = "服务器端口号", example = "3306")
    private Integer port;

    @Schema(name = "元数据-数据库类型", description = "数据库类型枚举", example = "MYSQL")
    private SourceDatabaseType databaseType;

    @Schema(name = "JDBC-路径", description = "JDBC连接路径", example = "dbname")
    private String route;

    @Schema(name = "元数据-用户名称", description = "数据库用户名", example = "mysql")
    private String userName;

    @Schema(name = "JDBC-连接类型", description = "JDBC连接类型枚举", example = "SERVICE_NAME")
    private SourceConnectType connectType;

    @Schema(name = "JDBC-数据库版本", description = "数据库版本信息", example = "8.0.33")
    private String databaseVersion;

    @Schema(name = "源数据源-Doris目录名称", description = "Doris目录名称", example = "patrol")
    private String dorisCatalogName;

    @Schema(name = "源数据源-系统编码", description = "目标系统的唯一编码", example = "patrol")
    private String defaultSystemCode;

    @Schema(name = "源数据源-启用状态", description = "是否启用此数据源", example = "true")
    private Boolean enabled;

    @Schema(name = "服务器-连接状态", description = "服务器连接状态", example = "true")
    private Boolean serverConnected;

    @Schema(name = "服务器-最后连接时间", description = "服务器最后连接成功时间")
    private Date serverConnectedDt;

    @Schema(name = "JDBC-连接状态", description = "JDBC连接状态", example = "true")
    private Boolean jdbcConnected;

    @Schema(name = "JDBC-最后连接时间", description = "JDBC最后连接成功时间")
    private Date jdbcConnectedDt;

    @Schema(name = "DORIS-连接状态", description = "Doris连接状态", example = "true")
    private Boolean dorisConnected;

    @Schema(name = "DORIS-最后连接时间", description = "Doris最后连接成功时间")
    private Date dorisConnectedDt;
}